In [4]:
import pandas
fname2 = '/Users/astyler/projects/ChargeCarData/csv/illah20100227_0.csv'
df = pandas.read_csv(fname2)
df.dtypes
#df
Out[4]:
In [7]:
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
import math
%matplotlib inline
rows = [df.iloc[i] for i in xrange(len(df))]
fig = plt.figure(figsize=(12,12))
ax = fig.add_subplot(111)
length = 0.00005
width = 0.00001
head_width = 0.00003
for r in rows:
dlon = length * math.cos(r.Bearing)
dlat = length * math.sin(r.Bearing)
ax.arrow(r.Longitude,r.Latitude,dlon,dlat,width=width, head_width=head_width)
plt.xlim([min(df.Longitude),max(df.Longitude)])
plt.ylim([min(df.Latitude),max(df.Latitude)])
Out[7]:
In [4]:
%matplotlib notebook
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
p = plt.figure().gca(projection='3d')
p.plot(df.Longitude, df.Latitude, df.Power)
p.set_xlabel('Lon')
p.set_ylabel('Lat')
p.set_zlabel('Power')
plt.show()
In [5]:
import bokeh.plotting as bp
bp.output_notebook()
p2 = bp.figure(title='Trip plot',tools = "pan,wheel_zoom,box_zoom,reset,resize",toolbar_location='below')
p2.line(df.Longitude, df.Latitude)
bp.show(p2)
In [6]:
import plotly.plotly as py
from plotly.graph_objs import *
plotlayout = Layout(
title='Trip plot',
scene=Scene(
xaxis=XAxis(
title='Longitude'
),
yaxis=YAxis(
title='Latitude'
),
zaxis=ZAxis(
title='Power (Watts)'
)
)
)
fig = Figure(data=[Scatter3d(x=df.Longitude, y=df.Latitude, z=df.Power,mode='lines')], layout=plotlayout)
py.iplot(fig, filename = 'triptestplot')
Out[6]: